class Solution {
    const int L = 10;
public:
    vector<string> findRepeatedDnaSequences(string s) {
        vector<string> ret;
        unordered_map<string, int> cnt;
        int n = s.size();
        for (int i = 0; i <= n - L; ++i)
        {
            string sub = s.substr(i, L);
            if (++cnt[sub] == 2)
            {
                ret.push_back(sub);
            }
        }
        return ret;
    }
};